package com.issoft.studentresitor.mapper;

import com.issoft.studentresitor.domain.pojo.Dorm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.issoft.studentresitor.domain.query.DormQuery;
import com.issoft.studentresitor.domain.vo.DormVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author GJH
 * @since 2025-09-14
 */
@Mapper
public interface DormMapper extends BaseMapper<Dorm> {

    DormVo countDrom();

    List<DormVo> queryDormPage(DormQuery query);
    /**
     * 根据user_id查询自己的宿舍信息
     * @param userId
     * @return
     */
    Dorm queryDormInfo(Integer userId);
    /**
     * 根据dorm_id查询宿舍信息
     * @param dormId
     * @return
     */
    @Select("select * from dorm where dorm_id = #{dormId}")
    Dorm selectByDormId(Integer dormId);
}
